﻿/*
* Copyright 2010 The Apache Software Foundation.
*
* Licensed under the Apache License, Version 2.0 (the "License")
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
*     http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Collections;
using System.Runtime.Serialization;

namespace Ngilead.Test.Models.Misc
{
    /// <summary>
    /// Test class for enum 
    /// </summary>
    [DataContract]
    public class Style
    {

        /// <summary>
        /// Horizontal alignment enumeration
        /// </summary>
        public enum HorizontalAlignment
        {
            /// <summary>Left</summary>
            LEFT,
            /// <summary>Center</summary>
            CENTER,
            /// <summary>Right</summary>
            RIGHT
        };

        /// <summary>
        /// Vertical alignment enumerations
        /// </summary>
        public enum VerticalAlignment
        {
            /// <summary>Top</summary>
            TOP,
            /// <summary>Middle</summary>
            MIDDLE,
            /// <summary>Bottom</summary>
            BOTTOM
        };

        /// <summary>
        /// Scroll enumeration
        /// </summary>
        public enum Scroll
        {
            /// <summary>Auto</summary>
            AUTO,
            /// <summary>Auto</summary>
            auto = AUTO,
            /// <summary>Always</summary>
            ALWAYS,
            /// <summary>Always</summary>
            scroll = ALWAYS,
            /// <summary>None</summary>
            NONE,
            /// <summary>Hidden</summary>
            hidden = NONE

            //private String value;

            //private Scroll(String value) 
            //{
            //    this.value = value;
            //}

            //public String Value()
            //{
            //    return _value; 
            //}
        };

        /// <summary>
        /// Sort direction enum
        /// </summary>
        public enum SortDir
        {
            /// <summary>None</summary>            
            NONE
                // {
                //    @Override
                //    public Comparator comparator(Comparator c) {
                //        return c;
                //    }
                // }
            ,
            /// <summary>Asc</summary>
            ASC
                // {
                //    @Override
                //    public <X> Comparator<X> comparator(final
                //            Comparator<X> c) {
                //        return new Comparator<X>() {
                //            public int compare(X o1, X o2) {
                //                return c.compare(o1, o2);
                //            }
                //        };
                //    }
                // }
            ,
            /// <summary>Desc</summary>
            DESC

            // {
            //    @Override
            //    public <X> Comparator<X> comparator(final
            //            Comparator<X> c) {
            //        return new Comparator<X>() {
            //            public int compare(X o1, X o2) {
            //                return c.compare(o2, o1);
            //            }
            //        };
            //    }
            // }

            //public static enumSortDir Toggle(SortDir sortDir) 
            //{
            //    return (sortDir == enumSortDir.ASC) ? enumSortDir.DESC : enumSortDir.ASC;
            //}  


            
              //An example of how to use this :
             
              //List<Something> list = ...
             
              //Collections.sort(list, SortDir.ASC.comparator(new Comparator() { public
              //int compare(Object o1, Object o2) { return ... } });
             
              //@return a Comparator that wraps the specific comparator that orders the results acording to the sort direction
             
            //public abstract <X> Comparator<X> comparator(Comparator<X> c);          
        };


        /// <summary>
        /// Layout out regions enum
        /// </summary>
        public enum LayoutRegion
        {
            /// <summary>North</summary>
            NORTH,
            /// <summary>East</summary>
            EAST,
            /// <summary>South</summary>
            SOUTH,
            /// <summary>West</summary>
            WEST,
            /// <summary>Center</summary>
            CENTER
        };

        /// <summary>
        /// Direction enum
        /// </summary>
        public enum Direction
        {
            /// <summary>Up</summary>
            UP,
            /// <summary>Down</summary>
            DOWN,
            /// <summary>Left</summary>
            LEFT,
            /// <summary>Right</summary>
            RIGHT
        };

        /// <summary>
        /// Scroll direction enum
        /// </summary>
        public enum ScrollDir
        {
            /// <summary>Vertical</summary>
            VERTICAL,
            /// <summary>Horizontal</summary>
            HORIZONTAL
        };

        /// <summary>
        /// Selection mode enum
        /// </summary>
        public enum SelectionMode
        {
            /// <summary>Single</summary>
            SINGLE,
            /// <summary>Simple</summary>
            SIMPLE,
            /// <summary>Multi</summary>
            MULTI
        };

        /// <summary>
        /// Orientation enum
        /// </summary>
        public enum Orientation
        {
            /// <summary>Vertical</summary>
            VERTICAL,
            /// <summary>Horizontal</summary>
            HORIZONTAL
        };

        /// <summary>
        /// A constant known to be zero (0)
        /// </summary>
        public static Int32 NONE = 0;

        /// <summary>
        /// Indicates that a default value should be used (value is	-1)
        /// </summary>
        public static Int32 DEFAULT = -1;

        /// <summary>
        /// Constant for marking a string as undefined rather than null
        /// </summary>
        public static String UNDEFINED = "undefined";

        private SortDir _sortDir = SortDir.ASC;

        /// <summary>
        /// Sort direction
        /// </summary>
        [DataMember]
        public SortDir Sortdir
        {
            get { return _sortDir; }
            set { _sortDir = value; }
        }
    }
}
